
local killed = achievements.GetValue( "Combine Harvester", "total", 0 )

local combine = { "npc_combine_s", "npc_metropolice" }
local function PlayerKilledNPC( msg )
	local victim, inflictor, attacker = msg:ReadString(), msg:ReadString(), msg:ReadEntity()
	
	if ( killed != 100 && attacker == LocalPlayer() ) then
		if ( table.HasValue( combine, victim ) ) then
			killed = math.Clamp( killed + 1, 0, 100 )
			achievements.SetValue( "Combine Harvester", "total", killed )
			achievements.Update( "Combine Harvester", killed / 100, killed .. "/100" )
		end
	end		
	
	return victim, inflictor, attacker
end
usermessage.AddHook( "PlayerKilledNPC", "Achievements.CombineHarvester", PlayerKilledNPC )

achievements.Register( "Combine Harvester", "Kill 100 Combine NPCs.", "achievements/combineharvester", killed / 100, killed .. "/100" )